{% extends '::base.html.twig' %}

{% block body -%}
<h1>Listado Provincias</h1>

<div id="dt2">
    <table class="datatable" id="table">
        <thead>
            <tr>
                <th>Num</th>
                <th>Pais</th>
                <th>Nombre</th>
                <th>Sigla</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        {% set count=0 %}
        {% for entity in entities %}
            {% set count=count+1 %}
                <tr>
                    <td>{{ count }}</td>
                    <td>{{ entity.pais }}</td>
                    <td>{{ entity.nombre }}</td>
                    <td>{{ entity.sigla }}</td>
                    <td>
                        <ul>
                            <li>
                                <a href="{{ path('provincias_edit', { 'id': entity.id }) }}">
                                    <button class="light small icon_only div_icon">
                                        <img src="{{ asset('bundles/admin/images/icons/small/grey/pencil.png') }}">
                                    </button>
                                </a>
                            </li>
                        </ul>
                    </td>
                </tr>
        {% endfor %}
            </tbody>
        </table>

    </div>
    <br/>
    <ul>
        <li>
            <a href="{{ path('provincias_new') }}" id="button-nuevo">
                <button class="dark green">
                    <div class="ui-icon ui-icon-plus"></div>
                    <span>Crear Nuevo</span>
                </button>
            </a>
        </li>
    </ul>
    {% endblock %}
